﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using BCGC.BLL.Helper;
using BCGC.BLL.MailManager;

public partial class Admin_PrivateMessage_add_privateMessage : AdminBasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
    }
   
    protected void btnSave_Click(object sender, EventArgs e)
    {
        PrivateMessage message = new PrivateMessage();
        message.Content = Server.HtmlEncode(fckContent.Value);
        message.IsActive = chkActive.Checked;
        message.IsMarketPlaceMessage = chkIsMarketPlaceMessage.Checked;
        message.IsRead = chkIsRead.Checked;
        message.IsSendEmail = chkIsSendEmail.Checked;
        message.ReceiverEmailID = txtEmailId.Text.Trim();
        message.ReceiverID = Convert.ToInt32(txtToUserID.Text.Trim());
        message.ReceiverName = txtReceiveName.Text.Trim();
        message.SendDate =Convert.ToDateTime(txtDate.Text);
        message.SenderID = Convert.ToInt32(txtFromUserID.Text.Trim());
        message.SenderName = txtUserName.Text.Trim();
        message.Subject = txtSubject.Text;
        if (message.Save())
        {
            uccResponse.SetSuccessMessage("PrivateMessage successfuly saved");
        }
        else
        {
            uccResponse.SetFailMessage("Failed to save PrivateMessage");
        }
    }
}
